<?php

namespace App\ZhCN\Api;

if (!defined('IN_PX'))
    exit;

use App\Repository;
use Phoenix\Support\MsgHelper;

class Archives {

    private function __RestController() {}

    private function __Route($value = '/api/archives') {}

    protected function __Inject(Repository\Archives $repoArc) {}

    public function view() {
        $this->repoArc->viewCount($_POST['id']);
        return true;
    }

    public function product() {
        $_POST['category_id'] = $_POST['categoryId'];
        $_rs = $this->repoArc->findArchives($_POST['language'], $_POST['category_id']);
        if ($_rs) {
            return  MsgHelper::err(0, 'ok', array('rsp' => $_rs));
        } else {
            return  MsgHelper::err(0, 'ok', array('rsp' => $_rs));
        }
    }

}
